//
//  Model000.m
//  MarketDataAnalyzer
//
//  Created by jiro on 10/03/29.
//  Copyright 2010 jiro music. All rights reserved.
//

#import "Model000.h"
#import "libpq-fe.h"
#import "../DataAnalyzer.h"

@implementation Model000


- (void) exec
{
	//	相関係数が 0.95 以上の銘柄の組み合わせに対して、それに続く３ヶ月の相関係数を計算する為の、分析計画を追加
	DbOperator* dbOperator = [ DbOperator defaultOperator ];
	NSString* s = [ NSString stringWithFormat: @"select * from %@ where %@ >= 0.95;",
		kText_StockCorrelationCoefficientJaTable, kText_CorrelationCoefficient
	];
	
	PGresult* res;
	if ( DbResponse_Success != [ dbOperator executeQuery: s intoResult: & res ] )
	{
		PQclear( res );
		NSLog( @"相関係数が 0.95 以上の銘柄の組み合わせの取得に失敗\n%@\n%@", [ dbOperator errorMessage ], s );
		return;
	}
	PQclear( res );

	[ dbOperator disconnect ];

}

@end
